home *** CD-ROM | disk | FTP | other *** search
- #pragma once
- /*****
- *
- * CustomHeaders.h
- *
- * Function definitions for custom functions defined in user modified files.
- *
- * This is a support file for "Grant's CGI Framework".
- * Please see the license agreement that accompanies the distribution package
- * for licensing details.
- *
- * Copyright ©1996 by Grant Neufeld
- * grant@acm.com
- * http://arpp.carleton.ca/cgi/framework/
- *
- *****/
-
- #include "MyConfiguration.h"
-
- #if kCompilingForWSAPI
- #include <WSAPI.h>
- #endif
-
- #include "CGI.h"
-
-
- /*** FUNCTION PROTOTYPES ***/
-
- /* Process a document.
- Called in AEHandlers.c */
- p_export OSErr CustomOpenDocument ( FSSpec * );
- #if !(kCompileWithout_MY_Names)
- #define MyOpenDocument CustomOpenDocument
- #endif
-
-
- /** CGI HANDLERS **/
- #if kCompileWithCGICode
-
- /* this function is where you do the actual CGI processing */
- p_export void CustomCGIProcess ( CGIHdl );
-
- /* this function will be called after the cgi result has been returned.
- It will contain the same CGIHdl that was used for the CustomCGIProcess */
- p_export void CustomCGIPostProcess ( CGIHdl );
-
- //••• WARNING: THIS FUNCTION WILL BE REMOVED IN THE FINAL RELEASE
- //••• YOU SHOULD MOVE THE HEADER TO YOUR OWN HEADER FILE
- //••• IF YOU WISH TO CONTINUE USING THIS FUNCTION IN YOUR SOURCE
- //••• All of it's functionality will be moved to
- //••• 'CustomStartup' in "MyHandlers.c"
- /* this function is called once at startup time.
- Put any CGI specific initialization you need to do in it. */
- p_export Boolean CustomCGIStartup ( void );
-
- /* this function is called at quitting time.
- Put any CGI specific cleanup you need to do in it.
- The Boolean will indicate true if you are allowed to make
- user interface calls. */
- p_export Boolean CustomCGIQuit ( Boolean );
-
- #if kCompilingForWSAPI
- /* this function is called when the plug-in recieves a register command
- from the WebSTAR server */
- WSAPI_ErrorCode CustomCGIWSAPIRegister ( WSAPI_CommandPBPtr );
- #endif
-
- #if !(kCompileWithout_MY_Names)
- #define MyCGIProcess CustomCGIProcess
- #define MyCGIStartup CustomCGIStartup
- #define MyCGIQuit CustomCGIQuit
- #endif
-
- #else /* if not kCompileWithCGICode */
-
- /* these are defined like this here so the StartupApplication function
- doesn't have to be messed with when compiling without the CGI module */
- // #define CustomCGIStartup() (true)
- #define CustomCGIQuit() (true)
-
- #endif /* kCompileWithCGICode */
-
-
- /** LISTSTAR HANDLERS **/
- #if kCompileWithListSTARCode
-
- /* this is the function which you must define for your particular application */
- p_export void CustomListSTARProcess ( LStarHdl );
-
- //••• WARNING: THIS FUNCTION WILL BE REMOVED IN THE FINAL RELEASE
- //••• YOU SHOULD MOVE THE HEADER TO YOUR OWN HEADER FILE
- //••• IF YOU WISH TO CONTINUE USING THIS FUNCTION IN YOUR SOURCE
- //••• All of it's functionality will be moved to
- //••• 'CustomStartup' in "MyHandlers.c"
- /* this function is called once at startup time.
- Put any initialization you need to do in it. */
- p_export Boolean CustomListSTARStartup ( void );
-
- #if !(kCompileWithout_MY_Names)
- #define MyListSTARProcess CustomListSTARProcess
- #define MyListSTARStartup CustomListSTARStartup
- #endif
-
- #else /* if not kCompileWithListSTARCode */
-
- // #define CustomListSTARStartup() (true)
-
- #endif /* kCompileWithListSTARCode */
-
-
- /** USER INTERFACE **/
-
- /* Called in EventUtil.c */
- p_export void CustomKeyPress ( EventRecord * );
- p_export OSErr CustomDoStartDrag ( EventRecord *, WindowPtr );
- p_export void CustomWindowIdle ( WindowPtr );
-
- /* Called in WindowUtil.c */
- p_export OSErr CustomCloseWindow ( WindowPtr );
- p_export void CustomActivateWindow ( WindowPtr, Boolean );
- p_export void CustomUpdateWindow ( WindowPtr );
- p_export void CustomClickInWindow ( WindowPtr, Point, Boolean * );
- p_export void CustomGrowWindow ( WindowPtr, Point );
-
- /* called in EventuUtil.c */
- p_export void CustomDialogMouseDown ( EventRecord *, DialogPtr, short );
-
- #if !(kCompileWithout_MY_Names)
- #define MyKeyPress CustomKeyPress
- #define MyDoStartDrag CustomDoStartDrag
- #define MyCloseWindow CustomCloseWindow
- #define MyActivateWindow CustomActivateWindow
- #define MyUpdateWindow CustomUpdateWindow
- #define MyClickInWindow CustomClickInWindow
- #endif
-
-
- /** PROCESS & THREADS **/
-
- #if kCompileWithPeriodicTask
- p_export void CustomPeriodicTask ( void );
- #endif
-
- /* this function will be called periodically from the deferred tasks
- thread when the application is not busy, (or at idle time if the
- thread can't be created).
- It should not use much time since events may come in while it is
- processing. This can be otherwise if you require the Thread Manager
- and use 'ProcessGiveTime' frequently.
- Note that it is possible for the deferred task thread to not be
- called at all if the application is continually busy (IE. new CGI
- events come in before old ones are finished so that there is no
- non-busy time). This is highly unlikely, but should be taken into
- account. I may provide a 'timer' mechanism in the future whereby
- you could set a time by which the deferred task must be called,
- even if the application is busy. */
- #if kCompileWithDeferredTask
- p_export void CustomDeferredTask ( void );
- #endif
-
-
- /** STARTUP & QUIT **/
-
- p_export SInt32 CustomStartup (
- #if kCompilingForWSAPI
- WSAPI_CommandPBPtr
- #else
- void
- #endif
- );
- #if !(kCompileWithout_MY_Names)
- #define MyStartup CustomStartup
- #endif
-
- p_export Boolean CustomQuit ( Boolean );
- #if !(kCompileWithout_MY_Names)
- #define MyQuit CustomQuit
- #endif
-
-
- /** MISCELLANEOUS **/
-
- /* this function is called if some sort of emergency has arisen.
- What you're basically being asked to do is release any memory,
- resources, files, etc. that you can.
- Called in CGI.c */
- p_export void CustomEmergencyHandler ( void );
-
-
- /***** EOF *****/
-